package cn.tedu.spring.config;

import cn.tedu.spring.eg1.Product;
import cn.tedu.spring.file.Database;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
@ComponentScan("cn.tedu.spring")
public class SpringConfig {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context
                = new AnnotationConfigApplicationContext
                (SpringConfig.class);
        Database database = context.getBean(Database.class);
        System.out.println(database);
        Product product = context.getBean(Product.class);
        System.out.println(product);
    }
}
